<html>
    <head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <meta name="layout" content="main" />
		<g:javascript library="prototype" />
		<resource:tooltip />
        <title>Report Module</title>		
    </head>
    <body>
        <div class="nav">
            <span class="menuButton"><a class="home" href="${createLinkTo(dir:'')}">Home</a></span>            
        </div>
		<br>
        <div class="body">
            <table border="1px">
			    <tr>
					<th style="color:#006dba">Systems</th>
					<th style="color:#006dba">Reports</th>
					<th style="color:#006dba">Parameters</th>
				</tr>
				<tr>
					<td style="width:140px" id="systems">						
					    <g:select style="width:140px;height:150px" name="reportSystemList.id" from="${reportSystemList}" 
								value="${reportSystemList.id?.encodeAsHTML()}" optionKey="id" multiple="false"
								onclick="${remoteFunction(action:'systemChange',update:'reports',params:'\'systemId=\' +this.value')}"									
								onmouseup="${remoteFunction(action:'reportChange',update:'parameters')}"
								onmousedown="${remoteFunction(action:'hideDateEntry',update:'paramEntryScreen',params:'\'systemId=\' +this.value')}"
								/>
					</td>
						
					<td id="reports" style="width:360px;height:155px">
						<g:select name="none" style="width:360px;height:150px" 
								from="${Report.get(0)}" multiple="false"/>
					</td>
					<td id="parameters" style="width:200px;height:155px">
					    <g:select name="none2" style="width:200px;height:150px" 
								from="${ReportParameter.get(0)}" multiple="false"/>
					</td>
				</tr>
				<tr>	
					<td colspan=3 >
					    <div id="paramEntryScreen">  
						</div>
					</td>
				</tr>					
			</table>							
        
		
		<div class="buttons">
			<g:form>
				<span class="button">
					<g:link style="background: #fff; border: 0px; color: #333; cursor: pointer;
							font-size: 10px; font-weight: bold; margin-left: 3px;
							overflow: visible; padding-bottom:80px;" 
							controller="jasperView" action="index" target="_blank">
						View Report
					</g:link>
				</span>		
				<g:submitToRemote class="input" id="resetAll" name="resetAll" 
						controller="reportModule" action="resetAllParam" 
						update="paramEntryScreen" value="Reset All"/>
			</g:form>
		</div>	
		</div>	
    </body>
</html>
